package com.indra.archetypeweb.entity.disc;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import com.indra.archetypeweb.entity.base.BaseEntity;
import com.indra.archetypeweb.entity.book.Book;
import com.indra.archetypeweb.entity.product.Product;

@Entity
@Table(name = "disc")
@NamedQueries(value = {
		@NamedQuery(name = Disc.FIND_BY_CATEGORY, query = "select d from Disc d where d.idCategory = :idCategory"),
		@NamedQuery(name = Disc.FIND_ALL, query = "select d from Disc d")})

public class Disc extends BaseEntity {
	
	public static final String FIND_ALL = "Disc.findAll";
	public static final String FIND_BY_CATEGORY = "Disc.findByCategory";

	@Id
	@GeneratedValue
	private Long id;

	@NotNull
	private Long idProduct;
	
	@NotNull
	@Size(min = 1, max = 25)
	private String group_disc;
	
	@NotNull
	@Size(min = 1, max = 25)
	@Pattern(regexp = "[A-Za-z ]*", message = "must contain only letters and spaces")
	private String company;
	
	@NotNull
	private Long idCategory;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getIdProduct() {
		return idProduct;
	}

	public void setIdProduct(Long idProduct) {
		this.idProduct = idProduct;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public Long getIdCategory() {
		return idCategory;
	}

	public void setIdCategory(Long idCategory) {
		this.idCategory = idCategory;
	}
	
	public String getGroup_disc() {
		return group_disc;
	}

	public void setGroup_disc(String group_disc) {
		this.group_disc = group_disc;
	}
}
